package com.sale.system.dubbo;

import com.sale.common.core.domain.R;
import com.sale.system.api.RemoteDocumentService;
import com.sale.system.api.domain.dto.SysDocumentAuditResultDto;
import com.sale.system.api.domain.dto.SysDocumentCheckResultDto;
import com.sale.system.api.domain.dto.SysDocumentResultDto;
import com.sale.system.domain.SysDocument;
import com.sale.system.domain.dto.SysDocumentAuditDto;
import com.sale.system.domain.dto.SysDocumentCheckDto;
import com.sale.system.service.ISysDocumentService;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 单据配置
 */
@RequiredArgsConstructor
@Service
@DubboService
public class RemoteDocumentServiceImpl implements RemoteDocumentService {

    private final ISysDocumentService sysDocumentService;

    /**
     * 获取单据配置信息
     *
     * @param docConfig
     * @return
     */
    @Override
    public SysDocumentResultDto getInfoConfig(Long docConfig) {
        SysDocumentResultDto sysDocumentResultDto = new SysDocumentResultDto();
        SysDocument sysDocument = sysDocumentService.selectDocumentConfigById(docConfig);
        BeanUtils.copyProperties(sysDocument, sysDocumentResultDto);

        return sysDocumentResultDto;
    }
}
